<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;

/* @var $this  yii\web\View */
/* @var $model mdm\admin\models\BizRule */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $searchModel mdm\admin\models\searchs\BizRule */

$this->title = Yii::t('rbac-admin', 'Rules');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="role-index">


    <p>
        <?= Html::a(Yii::t('rbac-admin',  '<i class="icon ion-plus"></i> ' .'规则'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?=
    GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            [
                'attribute' => 'name',
                'label' => Yii::t('rbac-admin', 'Name'),
            ],
            ['class' => 'yii\grid\ActionColumn',
                'header' => '操作',
                'template' => '{view} {update} {delete}',
                'buttons' => [
                    'view' => function ($url,$model,$key)   { return Html::a('查看', [$url], ['title' => '查看','class'=>"btn btn-primary btn-sm"]); },
                    'update' => function ($url,$model,$key) { return Html::a('编辑', [$url], ['title' => '编辑','class'=>'btn btn-default btn-sm']); },
                    'delete' => function ($url,$model, $key) { return Html::a('删除', [$url], ['title' => '删除', 'data-method' => 'post','data-confirm' => "sure delete?", 'class' => 'btn btn-danger btn-sm',]);},

                ],
            ]  ,
        ],
    ]);
    ?>

</div>
